/****************************************************************************//**
  \file hardwareInit.h

  \brief Hardware initialization routine header file.

  \author
    Atmel Corporation: http://www.atmel.com \n
    Support email: avr@atmel.com

  Copyright (c) 2008-2013, Atmel Corporation. All rights reserved.
  Licensed under Atmel's Limited License Agreement (BitCloudTM).

  \internal
  History:
    15.10.09 A. Taradov - Created
*******************************************************************************/
#ifndef _HARDWAREINIT_H
#define _HARDWAREINIT_H

#include <inttypes.h>
/******************************************************************************
                   Prototypes section
******************************************************************************/

#define WDP_16MS	0
#define WDP_32MS	(1 << WDP0)
#define WDP_64MS	(1 << WDP1)
#define WDP_128MS	(1 << WDP0) | (1 << WDP1)
#define WDP_250MS	(1 << WDP2)
#define WDP_500MS	(1 << WDP2) | (1 << WDP0)
#define WDP_1S		(1 << WDP2) | (1 << WDP1)
#define WDP_2S		(1 << WDP2) | (1 << WDP1) | (1 << WDP0)
#define WDP_4S		(1 << WDP3) 
#define WDP_8S		(1 << WDP3) | (1 << WDP0)

void LowLevelInit();
void LowLevelUninit();
void EnableWatchDog(uint8_t mode);
void DisableWatchDog();
void JumpToAddress(uint16_t address);
uint16_t ComputeCRC16(uint16_t length_in_words);

#define ResetWatchDog() asm volatile("wdr" ::)

#endif // _HARDWAREINIT_H

// eof hardwareInit.h
